package com.aispace.taichu.modules.controller;

import cn.hutool.core.util.StrUtil;
import com.aispace.taichu.exception.AgentException;
import com.aispace.taichu.modules.model.request.AgentRequest;
import com.aispace.taichu.modules.model.vo.AgentContext;
import com.aispace.taichu.response.ResponseResult;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/api/agent")
public class AgentController {



    @PostMapping("/execute")
    public ResponseResult<?> execute(@RequestBody AgentRequest request){
        log.info("execute request: {}", request);
        if(StrUtil.isEmpty(request.getQuestion())){
            AgentException.fatal("question content cannot be empty");
        }
        AgentContext context = AgentContext.builder()
                .question(request.getQuestion())
                .build();

        return ResponseResult.success();
    }






}
